﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbAbstractViewportData : OdAbstractViewPE
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbAbstractViewportData(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbAbstractViewportData_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbAbstractViewportData obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbAbstractViewportData()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbAbstractViewportData(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbAbstractViewportData cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbAbstractViewportData_cast(OdRxObject.getCPtr(pObj));
			OdDbAbstractViewportData result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbAbstractViewportData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbAbstractViewportData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbAbstractViewportData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbAbstractViewportData_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbAbstractViewportData_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbAbstractViewportData_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbAbstractViewportData createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbAbstractViewportData_createObject();
			OdDbAbstractViewportData result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbAbstractViewportData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbAbstractViewportData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbAbstractViewportData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setProps(OdRxObject pViewport, OdRxObject pSourceView)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setProps(this.swigCPtr, OdRxObject.getCPtr(pViewport), OdRxObject.getCPtr(pSourceView));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void setUcs(OdRxObject pDestinationView, OdRxObject pSourceView)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setUcs(this.swigCPtr, OdRxObject.getCPtr(pDestinationView), OdRxObject.getCPtr(pSourceView));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual bool hasViewOffset(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_hasViewOffset(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual bool applyPlotSettings(OdRxObject pDestinationView, OdRxObject pSourceView)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_applyPlotSettings(this.swigCPtr, OdRxObject.getCPtr(pDestinationView), OdRxObject.getCPtr(pSourceView));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isUcsSavedWithViewport(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isUcsSavedWithViewport(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setUcsPerViewport(OdRxObject pViewport, bool ucsPerViewport)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setUcsPerViewport(this.swigCPtr, OdRxObject.getCPtr(pViewport), ucsPerViewport);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isUcsFollowModeOn(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isUcsFollowModeOn(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setUcsFollowModeOn(OdRxObject pViewport, bool ucsFollowMode)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setUcsFollowModeOn(this.swigCPtr, OdRxObject.getCPtr(pViewport), ucsFollowMode);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual ushort circleSides(OdRxObject pViewport)
		{
			ushort result = TD_DbPINVOKE.OdDbAbstractViewportData_circleSides(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setCircleSides(OdRxObject pViewport, ushort circleSides)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setCircleSides(this.swigCPtr, OdRxObject.getCPtr(pViewport), circleSides);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isGridOn(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isGridOn(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setGridOn(OdRxObject pViewport, bool gridOn)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setGridOn(this.swigCPtr, OdRxObject.getCPtr(pViewport), gridOn);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGeVector2d gridIncrement(OdRxObject pViewport)
		{
			OdGeVector2d result = new OdGeVector2d(TD_DbPINVOKE.OdDbAbstractViewportData_gridIncrement(this.swigCPtr, OdRxObject.getCPtr(pViewport)), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setGridIncrement(OdRxObject pViewport, OdGeVector2d gridIncrement)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setGridIncrement(this.swigCPtr, OdRxObject.getCPtr(pViewport), OdGeVector2d.getCPtr(gridIncrement).Handle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isGridBoundToLimits(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isGridBoundToLimits(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setGridBoundToLimits(OdRxObject pViewport, bool gridDispFlag)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setGridBoundToLimits(this.swigCPtr, OdRxObject.getCPtr(pViewport), gridDispFlag);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isGridAdaptive(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isGridAdaptive(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setGridAdaptive(OdRxObject pViewport, bool gridDispFlag)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setGridAdaptive(this.swigCPtr, OdRxObject.getCPtr(pViewport), gridDispFlag);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isGridSubdivisionRestricted(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isGridSubdivisionRestricted(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setGridSubdivisionRestricted(OdRxObject pViewport, bool gridDispFlag)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setGridSubdivisionRestricted(this.swigCPtr, OdRxObject.getCPtr(pViewport), gridDispFlag);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isGridFollow(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isGridFollow(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setGridFollow(OdRxObject pViewport, bool gridDispFlag)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setGridFollow(this.swigCPtr, OdRxObject.getCPtr(pViewport), gridDispFlag);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual short gridMajor(OdRxObject pViewport)
		{
			short result = TD_DbPINVOKE.OdDbAbstractViewportData_gridMajor(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setGridMajor(OdRxObject pViewport, short nMajor)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setGridMajor(this.swigCPtr, OdRxObject.getCPtr(pViewport), nMajor);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isUcsIconVisible(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isUcsIconVisible(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setUcsIconVisible(OdRxObject pViewport, bool iconVisible)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setUcsIconVisible(this.swigCPtr, OdRxObject.getCPtr(pViewport), iconVisible);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isUcsIconAtOrigin(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isUcsIconAtOrigin(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setUcsIconAtOrigin(OdRxObject pViewport, bool atOrigin)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setUcsIconAtOrigin(this.swigCPtr, OdRxObject.getCPtr(pViewport), atOrigin);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isSnapOn(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isSnapOn(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSnapOn(OdRxObject pViewport, bool snapOn)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setSnapOn(this.swigCPtr, OdRxObject.getCPtr(pViewport), snapOn);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isSnapIsometric(OdRxObject pViewport)
		{
			bool result = TD_DbPINVOKE.OdDbAbstractViewportData_isSnapIsometric(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSnapIsometric(OdRxObject pViewport, bool snapIsometric)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setSnapIsometric(this.swigCPtr, OdRxObject.getCPtr(pViewport), snapIsometric);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double snapAngle(OdRxObject pViewport)
		{
			double result = TD_DbPINVOKE.OdDbAbstractViewportData_snapAngle(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSnapAngle(OdRxObject pViewport, double snapAngle)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setSnapAngle(this.swigCPtr, OdRxObject.getCPtr(pViewport), snapAngle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGePoint2d snapBase(OdRxObject pViewport)
		{
			OdGePoint2d result = new OdGePoint2d(TD_DbPINVOKE.OdDbAbstractViewportData_snapBase(this.swigCPtr, OdRxObject.getCPtr(pViewport)), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSnapBase(OdRxObject pViewport, OdGePoint2d snapBase)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setSnapBase(this.swigCPtr, OdRxObject.getCPtr(pViewport), OdGePoint2d.getCPtr(snapBase));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGeVector2d snapIncrement(OdRxObject pViewport)
		{
			OdGeVector2d result = new OdGeVector2d(TD_DbPINVOKE.OdDbAbstractViewportData_snapIncrement(this.swigCPtr, OdRxObject.getCPtr(pViewport)), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSnapIncrement(OdRxObject pViewport, OdGeVector2d snapIncrement)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setSnapIncrement(this.swigCPtr, OdRxObject.getCPtr(pViewport), OdGeVector2d.getCPtr(snapIncrement).Handle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual ushort snapIsoPair(OdRxObject pViewport)
		{
			ushort result = TD_DbPINVOKE.OdDbAbstractViewportData_snapIsoPair(this.swigCPtr, OdRxObject.getCPtr(pViewport));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSnapIsoPair(OdRxObject pViewport, ushort snapIsoPair)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setSnapIsoPair(this.swigCPtr, OdRxObject.getCPtr(pViewport), snapIsoPair);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGsView gsView(OdRxObject pViewport)
		{
			OdGsView result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbAbstractViewportData_gsView(this.swigCPtr, OdRxObject.getCPtr(pViewport)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setGsView(OdRxObject pViewport, OdGsView arg1)
		{
			TD_DbPINVOKE.OdDbAbstractViewportData_setGsView(this.swigCPtr, OdRxObject.getCPtr(pViewport), OdGsView.getCPtr(arg1));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual int navvcubedisplay(OdRxObject arg0)
		{
			int result = TD_DbPINVOKE.OdDbAbstractViewportData_navvcubedisplay(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult setNavvcubedisplay(OdRxObject arg0, int arg1)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbAbstractViewportData_setNavvcubedisplay(this.swigCPtr, OdRxObject.getCPtr(arg0), arg1);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
